Crystaltoolkit animation scene#730
Merged
minhsueh merged 5 commits intomaterialsproject:mainfrom Sep 18, 2025
Merged
Conversation
Member
|
Thanks @minhsueh! I just made you admin for this repo. Feel free to merge and publish a release (or release candidate) when this PR and the accompanying CTK PR are ready. |
Collaborator
Author
|
@tschaume Thank you! will do! |
tschaume
approved these changes
Sep 17, 2025
Member
tschaume
left a comment
There was a problem hiding this comment.
Looks good! Just some minor feedback.
| }); | ||
| } | ||
| } | ||
| console.log('new props'); |
Member
|
@minhsueh feel free to adress my comments as necessary and go ahead with merging this when you're ready. If the tests and build succeed on merge, a new package release should happen. I've already merged the accompanying PR in |
added 2 commits
September 18, 2025 09:51
…inhsueh/mp-react-components into crystaltoolkit_animation_scene
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Major changes:
Introduced
CrystalToolkitAnimationSceneto enable crystal structure animations. For eachObject3D, the scene renders keyframes (position, scale, or quaternion ...) and performs linear interpolation between frames for smooth transitions.feature 1: Added the
animateTypefield to interfaceSceneJsonObjectinsimple-scene.ts.This field can be either
"position"or"displacement", specifying the physical interpretation of theanimatedata in each scene entry.feature 2: Support for generating multiple keyframes added to
buildAnimationSupportinanimation-helper.tsfix: Previously, the code only parsed the first two frames; this has now been corrected
testing: The page
/components/crystal-toolkit/pages/CrystalStructureAnimationViewer/CrystalStructureAnimationViewer.tsxis used for testing with sample data, along with the scene files/components/crystal-toolkit/scene/phonon-animation-scene.tsand/components/crystal-toolkit/scene/phonon-animation-position-scene.ts.TODO:
BooleanKeyframeTracksupport for bond-breaking animations. Bonding is represented using two endpoints, typically derived frompymatgen.analysis.local_env.CrystalNNandpymatgen.analysis.graphs.StructureGraph. In cases where a bond breaks or reforms, the associatedObject3Dis toggled invisible to reflect the change visually.get_scenefromStructureGraphandSiteincrystal_toolkit.components.renderablesis used to generate animation data for atoms and bonds. A separate PR will be submitted to crystal_toolkit(Retain atom index info in _meta crystaltoolkit#470)Checklist
Local Testing
Run
npm startand navigate tohttp://localhost:1234/crystal_animation